package com.android.yummycookies;

import com.android.yummycookies.activeBoard.StoryGameEngine;
import com.android.yummycookies.model.theme.Theme;
import com.android.yummycookies.util.Constant;

import android.app.Activity;
import android.os.Bundle;
import android.view.SurfaceHolder;
import android.view.SurfaceView;

public class StoryGameActivity extends Activity implements
		SurfaceHolder.Callback {

	public static final String TAG = StoryGameActivity.class.getSimpleName();

	private SurfaceView surfaceView;
	private StoryGameEngine gameEngine;

	private Theme theme;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_story_game);

		surfaceView = (SurfaceView) findViewById(R.id.storySurfaceView);
		
		// recuperation des donnees
		Bundle bundle = getIntent().getExtras();

//		theme = bundle.getParcelable(THEME);
//		heightToScale = bundle.getInt(HEIGJT);
//		widthToScale = bundle.getInt(WIDTH_TO_SCALE);
//		
//		gameEngine = new StoryGameEngine(theme, surfaceView, maxHeightCookies, maxWidthCookies)
		
		// ajoute les callbacks de creation de la surfaceview
				surfaceView.getHolder().addCallback(this);
	}

	@Override
	public void surfaceCreated(SurfaceHolder holder) {
		gameEngine.start();
	}

	@Override
	public void surfaceChanged(SurfaceHolder holder, int format, int width,
			int height) {
	}

	@Override
	public void surfaceDestroyed(SurfaceHolder holder) {
		gameEngine.stop();
	}

}
